


<!DOCTYPE html>
<!--[if IE 8]><html class="no-js lt-ie9" lang="en" > <![endif]-->
<!--[if gt IE 8]><!--> <html class="no-js" lang="en" > <!--<![endif]-->
<head>
  <meta charset="utf-8">
  
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  
  <title>PyTorch Contribution Guide &mdash; PyTorch master documentation</title>
  

  
  
  
  
    <link rel="canonical" href="https://pytorch.org/docs/stable/community/contribution_guide.html"/>
  

  

  
  
    

  

  <link rel="stylesheet" href="../_static/css/theme.css" type="text/css" />
  <!-- <link rel="stylesheet" href="../_static/pygments.css" type="text/css" /> -->
  <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/katex@0.10.0-beta/dist/katex.min.css" type="text/css" />
  <link rel="stylesheet" href="../_static/css/jit.css" type="text/css" />
  <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/katex@0.11.1/dist/katex.min.css" type="text/css" />
  <link rel="stylesheet" href="../_static/katex-math.css" type="text/css" />
    <link rel="index" title="Index" href="../genindex.html" />
    <link rel="search" title="Search" href="../search.html" />
    <link rel="next" title="PyTorch Governance" href="governance.html" />
    <link rel="prev" title="torch.__config__" href="../__config__.html" /> 

  
  <script src="../_static/js/modernizr.min.js"></script>

  <!-- Preload the theme fonts -->

<link rel="preload" href="../_static/fonts/FreightSans/freight-sans-book.woff2" as="font" type="font/woff2" crossorigin="anonymous">
<link rel="preload" href="../_static/fonts/FreightSans/freight-sans-medium.woff2" as="font" type="font/woff2" crossorigin="anonymous">
<link rel="preload" href="../_static/fonts/IBMPlexMono/IBMPlexMono-Medium.woff2" as="font" type="font/woff2" crossorigin="anonymous">
<link rel="preload" href="../_static/fonts/FreightSans/freight-sans-bold.woff2" as="font" type="font/woff2" crossorigin="anonymous">
<link rel="preload" href="../_static/fonts/FreightSans/freight-sans-medium-italic.woff2" as="font" type="font/woff2" crossorigin="anonymous">
<link rel="preload" href="../_static/fonts/IBMPlexMono/IBMPlexMono-SemiBold.woff2" as="font" type="font/woff2" crossorigin="anonymous">

<!-- Preload the katex fonts -->

<link rel="preload" href="https://cdn.jsdelivr.net/npm/katex@0.10.0/dist/fonts/KaTeX_Math-Italic.woff2" as="font" type="font/woff2" crossorigin="anonymous">
<link rel="preload" href="https://cdn.jsdelivr.net/npm/katex@0.10.0/dist/fonts/KaTeX_Main-Regular.woff2" as="font" type="font/woff2" crossorigin="anonymous">
<link rel="preload" href="https://cdn.jsdelivr.net/npm/katex@0.10.0/dist/fonts/KaTeX_Main-Bold.woff2" as="font" type="font/woff2" crossorigin="anonymous">
<link rel="preload" href="https://cdn.jsdelivr.net/npm/katex@0.10.0/dist/fonts/KaTeX_Size1-Regular.woff2" as="font" type="font/woff2" crossorigin="anonymous">
<link rel="preload" href="https://cdn.jsdelivr.net/npm/katex@0.10.0/dist/fonts/KaTeX_Size4-Regular.woff2" as="font" type="font/woff2" crossorigin="anonymous">
<link rel="preload" href="https://cdn.jsdelivr.net/npm/katex@0.10.0/dist/fonts/KaTeX_Size2-Regular.woff2" as="font" type="font/woff2" crossorigin="anonymous">
<link rel="preload" href="https://cdn.jsdelivr.net/npm/katex@0.10.0/dist/fonts/KaTeX_Size3-Regular.woff2" as="font" type="font/woff2" crossorigin="anonymous">
<link rel="preload" href="https://cdn.jsdelivr.net/npm/katex@0.10.0/dist/fonts/KaTeX_Caligraphic-Regular.woff2" as="font" type="font/woff2" crossorigin="anonymous">
</head>

<div class="container-fluid header-holder tutorials-header" id="header-holder">
  <div class="container">
    <div class="header-container">
      <a class="header-logo" href="https://pytorch.org/" aria-label="PyTorch"></a>

      <div class="main-menu">
        <ul>
          <li>
            <a href="https://pytorch.org/get-started">Get Started</a>
          </li>

          <li>
            <div class="ecosystem-dropdown">
              <a id="dropdownMenuButton" data-toggle="ecosystem-dropdown">
                Ecosystem
              </a>
              <div class="ecosystem-dropdown-menu">
                <a class="nav-dropdown-item" href="https://pytorch.org/hub"">
                  <span class=dropdown-title>Models (Beta)</span>
                  <p>Discover, publish, and reuse pre-trained models</p>
                </a>
                <a class="nav-dropdown-item" href="https://pytorch.org/ecosystem">
                  <span class=dropdown-title>Tools & Libraries</span>
                  <p>Explore the ecosystem of tools and libraries</p>
                </a>
              </div>
            </div>
          </li>

          <li>
            <a href="https://pytorch.org/mobile">Mobile</a>
          </li>

          <li>
            <a href="https://pytorch.org/blog/">Blog</a>
          </li>

          <li>
            <a href="https://pytorch.org/tutorials">Tutorials</a>
          </li>

          <li class="active">
            <a href="https://pytorch.org/docs/stable/index.html">Docs</a>
          </li>

          <li>
            <div class="resources-dropdown">
              <a id="resourcesDropdownButton" data-toggle="resources-dropdown">
                Resources
              </a>
              <div class="resources-dropdown-menu">
                <a class="nav-dropdown-item" href="https://pytorch.org/resources"">
                  <span class=dropdown-title>Developer Resources</span>
                  <p>Find resources and get questions answered</p>
                </a>
                <a class="nav-dropdown-item" href="https://pytorch.org/features">
                  <span class=dropdown-title>About</span>
                  <p>Learn about PyTorch’s features and capabilities</p>
                </a>
              </div>
            </div>
          </li>

          <li>
            <a href="https://github.com/pytorch/pytorch">Github</a>
          </li>
        </ul>
      </div>

      <a class="main-menu-open-button" href="#" data-behavior="open-mobile-menu"></a>
    </div>

  </div>
</div>


<body class="pytorch-body">

   

    

    <div class="table-of-contents-link-wrapper">
      <span>Table of Contents</span>
      <a href="#" class="toggle-table-of-contents" data-behavior="toggle-table-of-contents"></a>
    </div>

    <nav data-toggle="wy-nav-shift" class="pytorch-left-menu" id="pytorch-left-menu">
      <div class="pytorch-side-scroll">
        <div class="pytorch-menu pytorch-menu-vertical" data-spy="affix" role="navigation" aria-label="main navigation">
          <div class="pytorch-left-menu-search">
            

            
              
              
                <div class="version">
                  master (1.5.0 )
                </div>
              
            

            


  


<div role="search">
  <form id="rtd-search-form" class="wy-form" action="../search.html" method="get">
    <input type="text" name="q" placeholder="Search Docs" />
    <input type="hidden" name="check_keywords" value="yes" />
    <input type="hidden" name="area" value="default" />
  </form>
</div>

            
          </div>

          
<div>
  <a style="color:#F05732" href="https://pytorch.org/docs/stable/community/contribution_guide.html">
    You are viewing unstable developer preview docs.
    Click here to view docs for latest stable release.
  </a>
</div>

            
            
              
            
            
              <p class="caption"><span class="caption-text">Notes</span></p>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../notes/amp_examples.html">Automatic Mixed Precision examples</a></li>
<li class="toctree-l1"><a class="reference internal" href="../notes/autograd.html">Autograd mechanics</a></li>
<li class="toctree-l1"><a class="reference internal" href="../notes/broadcasting.html">Broadcasting semantics</a></li>
<li class="toctree-l1"><a class="reference internal" href="../notes/cpu_threading_torchscript_inference.html">CPU threading and TorchScript inference</a></li>
<li class="toctree-l1"><a class="reference internal" href="../notes/cuda.html">CUDA semantics</a></li>
<li class="toctree-l1"><a class="reference internal" href="../notes/ddp.html">Distributed Data Parallel</a></li>
<li class="toctree-l1"><a class="reference internal" href="../notes/extending.html">Extending PyTorch</a></li>
<li class="toctree-l1"><a class="reference internal" href="../notes/faq.html">Frequently Asked Questions</a></li>
<li class="toctree-l1"><a class="reference internal" href="../notes/large_scale_deployments.html">Features for large-scale deployments</a></li>
<li class="toctree-l1"><a class="reference internal" href="../notes/multiprocessing.html">Multiprocessing best practices</a></li>
<li class="toctree-l1"><a class="reference internal" href="../notes/randomness.html">Reproducibility</a></li>
<li class="toctree-l1"><a class="reference internal" href="../notes/serialization.html">Serialization semantics</a></li>
<li class="toctree-l1"><a class="reference internal" href="../notes/windows.html">Windows FAQ</a></li>
</ul>
<p class="caption"><span class="caption-text">Language Bindings</span></p>
<ul>
<li class="toctree-l1"><a class="reference external" href="https://pytorch.org/cppdocs/">C++ API</a></li>
<li class="toctree-l1"><a class="reference internal" href="../packages.html">Javadoc</a></li>
</ul>
<p class="caption"><span class="caption-text">Python API</span></p>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../torch.html">torch</a></li>
<li class="toctree-l1"><a class="reference internal" href="../nn.html">torch.nn</a></li>
<li class="toctree-l1"><a class="reference internal" href="../nn.functional.html">torch.nn.functional</a></li>
<li class="toctree-l1"><a class="reference internal" href="../tensors.html">torch.Tensor</a></li>
<li class="toctree-l1"><a class="reference internal" href="../tensor_attributes.html">Tensor Attributes</a></li>
<li class="toctree-l1"><a class="reference internal" href="../tensor_view.html">Tensor Views</a></li>
<li class="toctree-l1"><a class="reference internal" href="../autograd.html">torch.autograd</a></li>
<li class="toctree-l1"><a class="reference internal" href="../cuda.html">torch.cuda</a></li>
<li class="toctree-l1"><a class="reference internal" href="../amp.html">torch.cuda.amp</a></li>
<li class="toctree-l1"><a class="reference internal" href="../distributed.html">torch.distributed</a></li>
<li class="toctree-l1"><a class="reference internal" href="../distributions.html">torch.distributions</a></li>
<li class="toctree-l1"><a class="reference internal" href="../hub.html">torch.hub</a></li>
<li class="toctree-l1"><a class="reference internal" href="../jit.html">torch.jit</a></li>
<li class="toctree-l1"><a class="reference internal" href="../nn.init.html">torch.nn.init</a></li>
<li class="toctree-l1"><a class="reference internal" href="../onnx.html">torch.onnx</a></li>
<li class="toctree-l1"><a class="reference internal" href="../optim.html">torch.optim</a></li>
<li class="toctree-l1"><a class="reference internal" href="../quantization.html">Quantization</a></li>
<li class="toctree-l1"><a class="reference internal" href="../rpc/index.html">Distributed RPC Framework</a></li>
<li class="toctree-l1"><a class="reference internal" href="../random.html">torch.random</a></li>
<li class="toctree-l1"><a class="reference internal" href="../sparse.html">torch.sparse</a></li>
<li class="toctree-l1"><a class="reference internal" href="../storage.html">torch.Storage</a></li>
<li class="toctree-l1"><a class="reference internal" href="../bottleneck.html">torch.utils.bottleneck</a></li>
<li class="toctree-l1"><a class="reference internal" href="../checkpoint.html">torch.utils.checkpoint</a></li>
<li class="toctree-l1"><a class="reference internal" href="../cpp_extension.html">torch.utils.cpp_extension</a></li>
<li class="toctree-l1"><a class="reference internal" href="../data.html">torch.utils.data</a></li>
<li class="toctree-l1"><a class="reference internal" href="../dlpack.html">torch.utils.dlpack</a></li>
<li class="toctree-l1"><a class="reference internal" href="../model_zoo.html">torch.utils.model_zoo</a></li>
<li class="toctree-l1"><a class="reference internal" href="../tensorboard.html">torch.utils.tensorboard</a></li>
<li class="toctree-l1"><a class="reference internal" href="../type_info.html">Type Info</a></li>
<li class="toctree-l1"><a class="reference internal" href="../named_tensor.html">Named Tensors</a></li>
<li class="toctree-l1"><a class="reference internal" href="../name_inference.html">Named Tensors operator coverage</a></li>
<li class="toctree-l1"><a class="reference internal" href="../__config__.html">torch.__config__</a></li>
</ul>
<p class="caption"><span class="caption-text">Libraries</span></p>
<ul>
<li class="toctree-l1"><a class="reference external" href="https://pytorch.org/audio">torchaudio</a></li>
<li class="toctree-l1"><a class="reference external" href="https://pytorch.org/text">torchtext</a></li>
<li class="toctree-l1"><a class="reference external" href="https://pytorch.org/elastic/">TorchElastic</a></li>
<li class="toctree-l1"><a class="reference external" href="https://pytorch.org/serve">TorchServe</a></li>
<li class="toctree-l1"><a class="reference external" href="http://pytorch.org/xla/">PyTorch on XLA Devices</a></li>
</ul>
<p class="caption"><span class="caption-text">Community</span></p>
<ul class="current">
<li class="toctree-l1 current"><a class="current reference internal" href="#">PyTorch Contribution Guide</a></li>
<li class="toctree-l1"><a class="reference internal" href="governance.html">PyTorch Governance</a></li>
<li class="toctree-l1"><a class="reference internal" href="persons_of_interest.html">PyTorch Governance | Persons of Interest</a></li>
</ul>

            
          

        </div>
      </div>
    </nav>

    <div class="pytorch-container">
      <div class="pytorch-page-level-bar" id="pytorch-page-level-bar">
        <div class="pytorch-breadcrumbs-wrapper">
          















<div role="navigation" aria-label="breadcrumbs navigation">

  <ul class="pytorch-breadcrumbs">
    
      <li>
        <a href="../index.html">
          
            Docs
          
        </a> &gt;
      </li>

        
      <li>PyTorch Contribution Guide</li>
    
    
      <li class="pytorch-breadcrumbs-aside">
        
            
            <a href="../_sources/community/contribution_guide.rst.txt" rel="nofollow"><img src="../_static/images/view-page-source-icon.svg"></a>
          
        
      </li>
    
  </ul>

  
</div>
        </div>

        <div class="pytorch-shortcuts-wrapper" id="pytorch-shortcuts-wrapper">
          Shortcuts
        </div>
      </div>

      <section data-toggle="wy-nav-shift" id="pytorch-content-wrap" class="pytorch-content-wrap">
        <div class="pytorch-content-left">

        
          
          <div class="rst-content">
          
            <div role="main" class="main-content" itemscope="itemscope" itemtype="http://schema.org/Article">
             <article itemprop="articleBody" id="pytorch-article" class="pytorch-article">
              
  <div class="section" id="pytorch-contribution-guide">
<h1>PyTorch Contribution Guide<a class="headerlink" href="#pytorch-contribution-guide" title="Permalink to this headline">¶</a></h1>
<p>PyTorch is a GPU-accelerated Python tensor computation package for
building deep neural networks built on tape-based autograd systems.</p>
<div class="section" id="the-pytorch-contribution-process">
<h2>The PyTorch Contribution Process<a class="headerlink" href="#the-pytorch-contribution-process" title="Permalink to this headline">¶</a></h2>
<p>The PyTorch organization is governed by <a class="reference external" href="/docs/source/community/governance.rst">PyTorch
Governance</a>.</p>
<p>The PyTorch development process involves a healthy amount of open
discussions between the core development team and the community.</p>
<p>PyTorch operates similar to most open source projects on GitHub.
However, if you’ve never contributed to an open source project before,
here is the basic process.</p>
<ul class="simple">
<li><p><strong>Figure out what you’re going to work on.</strong> The majority of open
source contributions come from people scratching their own itches.
However, if you don’t know what you want to work on, or are just
looking to get more acquainted with the project, here are some tips
for how to find appropriate tasks:</p>
<ul>
<li><p>Look through the <a class="reference external" href="https://github.com/pytorch/pytorch/issues/">issue
tracker</a> and see if
there are any issues you know how to fix. Issues that are
confirmed by other contributors tend to be better to investigate.
We also maintain some labels for issues which are likely to be
good for new people, e.g., <strong>bootcamp</strong> and <strong>1hr</strong>, although
these labels are less well maintained.</p></li>
<li><p>Join us on Slack and let us know you’re interested in getting to
know PyTorch. We’re very happy to help out researchers and
partners get up to speed with the codebase.</p></li>
</ul>
</li>
<li><p><strong>Figure out the scope of your change and reach out for design
comments on a GitHub issue if it’s large.</strong> The majority of pull
requests are small; in that case, no need to let us know about what
you want to do, just get cracking. But if the change is going to be
large, it’s usually a good idea to get some design comments about it
first.</p>
<ul>
<li><p>If you don’t know how big a change is going to be, we can help you
figure it out! Just post about it on issues or Slack.</p></li>
<li><p>Some feature additions are very standardized; for example, lots of
people add new operators or optimizers to PyTorch. Design
discussion in these cases boils down mostly to, “Do we want this
operator/optimizer?” Giving evidence for its utility, e.g., usage
in peer reviewed papers, or existence in other frameworks, helps a
bit when making this case.</p>
<ul>
<li><p><strong>Adding operators / algorithms from recently-released research</strong>
is generally not accepted, unless there is overwhelming evidence that
this newly published work has ground-breaking results and will eventually
become a standard in the field. If you are not sure where your method falls,
open an issue first before implementing a PR.</p></li>
</ul>
</li>
<li><p>Core changes and refactors can be quite difficult to coordinate,
as the pace of development on PyTorch master is quite fast.
Definitely reach out about fundamental or cross-cutting changes;
we can often give guidance about how to stage such changes into
more easily reviewable pieces.</p></li>
</ul>
</li>
<li><p><strong>Code it out!</strong></p>
<ul>
<li><p>See the technical guide for advice for working with PyTorch in a
technical form.</p></li>
</ul>
</li>
<li><p><strong>Open a pull request.</strong></p>
<ul>
<li><p>If you are not ready for the pull request to be reviewed, tag it
with [WIP]. We will ignore it when doing review passes. If you are
working on a complex change, it’s good to start things off as WIP,
because you will need to spend time looking at CI results to see
if things worked out or not.</p></li>
<li><p>Find an appropriate reviewer for your change. We have some folks
who regularly go through the PR queue and try to review
everything, but if you happen to know who the maintainer for a
given subsystem affected by your patch is, feel free to include
them directly on the pull request. You can learn more about this
structure at PyTorch Subsystem Ownership.</p></li>
</ul>
</li>
<li><p><strong>Iterate on the pull request until it’s accepted!</strong></p>
<ul>
<li><p>We’ll try our best to minimize the number of review roundtrips and
block PRs only when there are major issues. For the most common
issues in pull requests, take a look at <a class="reference external" href="#common-mistakes-to-avoid">Common Mistakes</a>.</p></li>
<li><p>Once a pull request is accepted and CI is passing, there is
nothing else you need to do; we will merge the PR for you.</p></li>
</ul>
</li>
</ul>
</div>
<div class="section" id="getting-started">
<h2>Getting Started<a class="headerlink" href="#getting-started" title="Permalink to this headline">¶</a></h2>
<div class="section" id="proposing-new-features">
<h3>Proposing new features<a class="headerlink" href="#proposing-new-features" title="Permalink to this headline">¶</a></h3>
<p>New feature ideas are best discussed on a specific issue. Please include
as much information as you can, any accompanying data, and your proposed
solution. The PyTorch team and community frequently reviews new issues
and comments where they think they can help. If you feel confident in
your solution, go ahead and implement it.</p>
</div>
<div class="section" id="reporting-issues">
<h3>Reporting Issues<a class="headerlink" href="#reporting-issues" title="Permalink to this headline">¶</a></h3>
<p>If you’ve identified an issue, first search through the <a class="reference external" href="https://github.com/pytorch/pytorch/issues">list of
existing issues</a> on the
repo. If you are unable to find a similar issue, then create a new one.
Supply as much information you can to reproduce the problematic
behavior. Also, include any additional insights like the behavior you
expect.</p>
</div>
<div class="section" id="implementing-features-or-fixing-bugs">
<h3>Implementing Features or Fixing Bugs<a class="headerlink" href="#implementing-features-or-fixing-bugs" title="Permalink to this headline">¶</a></h3>
<p>If you want to fix a specific issue, it’s best to comment on the
individual issue with your intent. However, we do not lock or assign
issues except in cases where we have worked with the developer before.
It’s best to strike up a conversation on the issue and discuss your
proposed solution. The PyTorch team can provide guidance that saves you
time.</p>
<p>Issues that are labeled first-new-issue, low, or medium priority provide
the best entrance point are great places to start.</p>
</div>
<div class="section" id="adding-tutorials">
<h3>Adding Tutorials<a class="headerlink" href="#adding-tutorials" title="Permalink to this headline">¶</a></h3>
<p>A great deal of the tutorials on <a class="reference external" href="http://pytorch.org/">pytorch.org</a>
come from the community itself and we welcome additional contributions.
To learn more about how to contribute a new tutorial you can learn more
here: <a class="reference external" href="https://github.com/pytorch/tutorials/#contributing">PyTorch.org Tutorial Contribution Guide on
Github</a></p>
</div>
<div class="section" id="improving-documentation-tutorials">
<h3>Improving Documentation &amp; Tutorials<a class="headerlink" href="#improving-documentation-tutorials" title="Permalink to this headline">¶</a></h3>
<p>We aim to produce high quality documentation and tutorials. On rare
occasions that content includes typos or bugs. If you find something you
can fix, send us a pull request for consideration.</p>
<p>Take a look at the <a class="reference external" href="#on-documentation">Documentation</a> section to learn how our system
works.</p>
</div>
<div class="section" id="participating-in-online-discussions">
<h3>Participating in online discussions<a class="headerlink" href="#participating-in-online-discussions" title="Permalink to this headline">¶</a></h3>
<p>You can find active discussions happening on the PyTorch Discussion
<a class="reference external" href="https://discuss.pytorch.org/">forum</a>.</p>
</div>
<div class="section" id="submitting-pull-requests-to-fix-open-issues">
<h3>Submitting pull requests to fix open issues<a class="headerlink" href="#submitting-pull-requests-to-fix-open-issues" title="Permalink to this headline">¶</a></h3>
<p>You can view a list of all open issues
<a class="reference external" href="https://github.com/pytorch/pytorch/issues">here</a>. Commenting on an
issue is a great way to get the attention of the team. From here you can
share your ideas and how you plan to resolve the issue.</p>
<p>For more challenging issues, the team will provide feedback and
direction for how to best solve the issue.</p>
<p>If you’re not able to fix the issue itself, commenting and sharing
whether you can reproduce the issue can be useful for helping the team
identify problem areas.</p>
</div>
<div class="section" id="reviewing-open-pull-requests">
<h3>Reviewing open pull requests<a class="headerlink" href="#reviewing-open-pull-requests" title="Permalink to this headline">¶</a></h3>
<p>We appreciate your help reviewing and commenting on pull requests. Our
team strives to keep the number of open pull requests at a manageable
size, we respond quickly for more information if we need it, and we
merge PRs that we think are useful. However, due to the high level of
interest, additional eyes on pull requests is appreciated.</p>
</div>
<div class="section" id="improving-code-readability">
<h3>Improving code readability<a class="headerlink" href="#improving-code-readability" title="Permalink to this headline">¶</a></h3>
<p>Improve code readability helps everyone. It is often better to submit a
small number of pull requests that touch few files versus a large pull
request that touches many files. Starting a discussion in the PyTorch
forum <a class="reference external" href="https://discuss.pytorch.org/">here</a> or on an issue related to
your improvement is the best way to get started.</p>
</div>
<div class="section" id="adding-test-cases-to-make-the-codebase-more-robust">
<h3>Adding test cases to make the codebase more robust<a class="headerlink" href="#adding-test-cases-to-make-the-codebase-more-robust" title="Permalink to this headline">¶</a></h3>
<p>Additional test coverage is appreciated.</p>
</div>
<div class="section" id="promoting-pytorch">
<h3>Promoting PyTorch<a class="headerlink" href="#promoting-pytorch" title="Permalink to this headline">¶</a></h3>
<p>Your use of PyTorch in your projects, research papers, write ups, blogs,
or general discussions around the internet helps to raise awareness for
PyTorch and our growing community. Please reach out to
<a class="reference external" href="http://mailto:pytorch-marketing&#64;fb.com/">pytorch-marketing&#64;fb.com</a>
for marketing support.</p>
</div>
<div class="section" id="triaging-issues">
<h3>Triaging issues<a class="headerlink" href="#triaging-issues" title="Permalink to this headline">¶</a></h3>
<p>If you feel that an issue could benefit from a particular tag or level
of complexity comment on the issue and share your opinion. If an you
feel an issue isn’t categorized properly comment and let the team know.</p>
</div>
</div>
<div class="section" id="about-open-source-development">
<h2>About open source development<a class="headerlink" href="#about-open-source-development" title="Permalink to this headline">¶</a></h2>
<p>If this is your first time contributing to an open source project, some
aspects of the development process may seem unusual to you.</p>
<ul class="simple">
<li><p><strong>There is no way to “claim” issues.</strong> People often want to “claim”
an issue when they decide to work on it, to ensure that there isn’t
wasted work when someone else ends up working on it. This doesn’t
really work too well in open source, since someone may decide to work
on something, and end up not having time to do it. Feel free to give
information in an advisory fashion, but at the end of the day, we
will take running code and rough consensus.</p></li>
<li><p><strong>There is a high bar for new functionality that is added.</strong> Unlike
in a corporate environment, where the person who wrote code
implicitly “owns” it and can be expected to take care of it in the
beginning of its lifetime, once a pull request is merged into an open
source project, it immediately becomes the collective responsibility
of all maintainers on the project. When we merge code, we are saying
that we, the maintainers, are able to review subsequent changes and
make a bugfix to the code. This naturally leads to a higher standard
of contribution.</p></li>
</ul>
</div>
<div class="section" id="common-mistakes-to-avoid">
<h2>Common Mistakes To Avoid<a class="headerlink" href="#common-mistakes-to-avoid" title="Permalink to this headline">¶</a></h2>
<ul class="simple">
<li><p><strong>Did you add tests?</strong> (Or if the change is hard to test, did you
describe how you tested your change?)</p>
<ul>
<li><p>We have a few motivations for why we ask for tests:</p>
<ol class="arabic simple">
<li><p>to help us tell if we break it later</p></li>
<li><p>to help us tell if the patch is correct in the first place
(yes, we did review it, but as Knuth says, “beware of the
following code, for I have not run it, merely proven it
correct”)</p></li>
</ol>
</li>
<li><p>When is it OK not to add a test? Sometimes a change can’t be
conveniently tested, or the change is so obviously correct (and
unlikely to be broken) that it’s OK not to test it. On the
contrary, if a change is seems likely (or is known to be likely)
to be accidentally broken, it’s important to put in the time to
work out a testing strategy.</p></li>
</ul>
</li>
<li><p><strong>Is your PR too long?</strong></p>
<ul>
<li><p>It’s easier for us to review and merge small PRs. Difficulty of
reviewing a PR scales nonlinearly with its size.</p></li>
<li><p>When is it OK to submit a large PR? It helps a lot if there was a
corresponding design discussion in an issue, with sign off from
the people who are going to review your diff. We can also help
give advice about how to split up a large change into individually
shippable parts. Similarly, it helps if there is a complete
description of the contents of the PR: it’s easier to review code
if we know what’s inside!</p></li>
</ul>
</li>
<li><p><strong>Comments for subtle things?</strong> In cases where behavior of your code
is nuanced, please include extra comments and documentation to allow
us to better understand the intention of your code.</p></li>
<li><p><strong>Did you add a hack?</strong> Sometimes a hack is the right answer. But
usually we will have to discuss it.</p></li>
<li><p><strong>Do you want to touch a very core component?</strong> In order to prevent
major regressions, pull requests that touch core components receive
extra scrutiny. Make sure you’ve discussed your changes with the team
before undertaking major changes.</p></li>
<li><p><strong>Want to add a new feature?</strong> If you want to add new features,
comment your intention on the related issue. Our team tries to
comment on and provide feedback to the community. It’s better to have
an open discussion with the team and the rest of the community prior
to building new features. This helps us stay aware of what you’re
working on and increases the chance that it’ll be merged.</p></li>
<li><p><strong>Did you touch unrelated code to the PR?</strong> To aid in code review,
please only include files in your pull request that are directly
related to your changes.</p></li>
</ul>
<p>Frequently asked questions</p>
<ul class="simple">
<li><p><strong>How can I contribute as a reviewer?</strong> There is lots of value if
community developer reproduce issues, try out new functionality, or
otherwise help us identify or troubleshoot issues. Commenting on
tasks or pull requests with your environment details is helpful and
appreciated.</p></li>
<li><p><strong>CI tests failed, what does it mean?</strong> Maybe you need to merge with
master or rebase with latest changes. Pushing your changes should
re-trigger CI tests. If the tests persist, you’ll want to trace
through the error messages and resolve the related issues.</p></li>
<li><p><strong>What are the most high risk changes?</strong> Anything that touches build
configuration is an risky area. Please avoid changing these unless
you’ve had a discussion with the team beforehand.</p></li>
<li><p><strong>Hey, a commit showed up on my branch, what’s up with that?</strong>
Sometimes another community member will provide a patch or fix to
your pull request or branch. This is often needed for getting CI tests
to pass.</p></li>
</ul>
</div>
<div class="section" id="on-documentation">
<h2>On Documentation<a class="headerlink" href="#on-documentation" title="Permalink to this headline">¶</a></h2>
<div class="section" id="python-docs">
<h3>Python Docs<a class="headerlink" href="#python-docs" title="Permalink to this headline">¶</a></h3>
<p>PyTorch documentation is generated from python source using
<a class="reference external" href="http://www.sphinx-doc.org/en/master/">Sphinx</a>. Generated HTML is
copied to the docs folder in the master branch of
<a class="reference external" href="https://github.com/pytorch/pytorch.github.io/tree/master/docs">pytorch.github.io</a>,
and is served via GitHub pages.</p>
<ul class="simple">
<li><p>Site: <a class="reference external" href="http://pytorch.org/docs">http://pytorch.org/docs</a></p></li>
<li><p>GitHub: <a class="reference external" href="https://github.com/pytorch/pytorch/tree/master/docs">https://github.com/pytorch/pytorch/tree/master/docs</a></p></li>
<li><p>Served from:
<a class="reference external" href="https://github.com/pytorch/pytorch.github.io/tree/master/docs">https://github.com/pytorch/pytorch.github.io/tree/master/doc</a></p></li>
</ul>
</div>
<div class="section" id="c-docs">
<h3>C++ Docs<a class="headerlink" href="#c-docs" title="Permalink to this headline">¶</a></h3>
<p>For C++ code we use Doxygen to generate the content files. The C++ docs
are built on a special server and the resulting files are copied to the
<a class="reference external" href="https://github.com/pytorch/cppdocs">https://github.com/pytorch/cppdocs</a> repo, and are served from GitHub
pages.</p>
<ul class="simple">
<li><p>Site: <a class="reference external" href="http://pytorch.org/cppdocs">http://pytorch.org/cppdocs</a></p></li>
<li><p>GitHub: <a class="reference external" href="https://github.com/pytorch/pytorch/tree/master/docs/cpp">https://github.com/pytorch/pytorch/tree/master/docs/cpp</a></p></li>
<li><p>Served from: <a class="reference external" href="https://github.com/pytorch/cppdocs">https://github.com/pytorch/cppdocs</a></p></li>
</ul>
</div>
</div>
<div class="section" id="tutorials">
<h2>Tutorials<a class="headerlink" href="#tutorials" title="Permalink to this headline">¶</a></h2>
<p>PyTorch tutorials are documents used to help understand using PyTorch to
accomplish specific tasks or to understand more holistic concepts.
Tutorials are built using
<a class="reference external" href="https://sphinx-gallery.readthedocs.io/en/latest/index.html">Sphinx-Gallery</a>
from executable python sources files, or from restructured-text (rst)
files.</p>
<ul class="simple">
<li><p>Site: <a class="reference external" href="http://pytorch.org/tutorials">http://pytorch.org/tutorials</a></p></li>
<li><p>GitHub: <a class="reference external" href="http://github.com/pytorch/tutorials">http://github.com/pytorch/tutorials</a></p></li>
</ul>
<div class="section" id="tutorials-build-overview">
<h3>Tutorials Build Overview<a class="headerlink" href="#tutorials-build-overview" title="Permalink to this headline">¶</a></h3>
<p>For tutorials, <a class="reference external" href="https://github.com/pytorch/tutorials/pulls">pull
requests</a> trigger a
rebuild the entire site using CircleCI to test the effects of the
change. This build is sharded into 9 worker builds and takes around 40
minutes total. At the same time, we do a Netlify build using <em>make
html-noplot</em>, which builds the site without rendering the notebook
output into pages for quick review.</p>
<p>After a PR is accepted, the site is rebuilt and deployed from CircleCI.</p>
</div>
<div class="section" id="contributing-a-new-tutorial">
<h3>Contributing a new Tutorial<a class="headerlink" href="#contributing-a-new-tutorial" title="Permalink to this headline">¶</a></h3>
<p><a class="reference external" href="https://github.com/pytorch/tutorials/#contributing">PyTorch.org Tutorial Contribution
Guide</a></p>
</div>
</div>
</div>


             </article>
             
            </div>
            <footer>
  
    <div class="rst-footer-buttons" role="navigation" aria-label="footer navigation">
      
        <a href="governance.html" class="btn btn-neutral float-right" title="PyTorch Governance" accesskey="n" rel="next">Next <img src="../_static/images/chevron-right-orange.svg" class="next-page"></a>
      
      
        <a href="../__config__.html" class="btn btn-neutral" title="torch.__config__" accesskey="p" rel="prev"><img src="../_static/images/chevron-right-orange.svg" class="previous-page"> Previous</a>
      
    </div>
  

  

    <hr>

  

  <div role="contentinfo">
    <p>
        &copy; Copyright 2019, Torch Contributors.

    </p>
  </div>
    
      <div>
        Built with <a href="http://sphinx-doc.org/">Sphinx</a> using a <a href="https://github.com/rtfd/sphinx_rtd_theme">theme</a> provided by <a href="https://readthedocs.org">Read the Docs</a>.
      </div>
     

</footer>

          </div>
        </div>

        <div class="pytorch-content-right" id="pytorch-content-right">
          <div class="pytorch-right-menu" id="pytorch-right-menu">
            <div class="pytorch-side-scroll" id="pytorch-side-scroll-right">
              <ul>
<li><a class="reference internal" href="#">PyTorch Contribution Guide</a><ul>
<li><a class="reference internal" href="#the-pytorch-contribution-process">The PyTorch Contribution Process</a></li>
<li><a class="reference internal" href="#getting-started">Getting Started</a><ul>
<li><a class="reference internal" href="#proposing-new-features">Proposing new features</a></li>
<li><a class="reference internal" href="#reporting-issues">Reporting Issues</a></li>
<li><a class="reference internal" href="#implementing-features-or-fixing-bugs">Implementing Features or Fixing Bugs</a></li>
<li><a class="reference internal" href="#adding-tutorials">Adding Tutorials</a></li>
<li><a class="reference internal" href="#improving-documentation-tutorials">Improving Documentation &amp; Tutorials</a></li>
<li><a class="reference internal" href="#participating-in-online-discussions">Participating in online discussions</a></li>
<li><a class="reference internal" href="#submitting-pull-requests-to-fix-open-issues">Submitting pull requests to fix open issues</a></li>
<li><a class="reference internal" href="#reviewing-open-pull-requests">Reviewing open pull requests</a></li>
<li><a class="reference internal" href="#improving-code-readability">Improving code readability</a></li>
<li><a class="reference internal" href="#adding-test-cases-to-make-the-codebase-more-robust">Adding test cases to make the codebase more robust</a></li>
<li><a class="reference internal" href="#promoting-pytorch">Promoting PyTorch</a></li>
<li><a class="reference internal" href="#triaging-issues">Triaging issues</a></li>
</ul>
</li>
<li><a class="reference internal" href="#about-open-source-development">About open source development</a></li>
<li><a class="reference internal" href="#common-mistakes-to-avoid">Common Mistakes To Avoid</a></li>
<li><a class="reference internal" href="#on-documentation">On Documentation</a><ul>
<li><a class="reference internal" href="#python-docs">Python Docs</a></li>
<li><a class="reference internal" href="#c-docs">C++ Docs</a></li>
</ul>
</li>
<li><a class="reference internal" href="#tutorials">Tutorials</a><ul>
<li><a class="reference internal" href="#tutorials-build-overview">Tutorials Build Overview</a></li>
<li><a class="reference internal" href="#contributing-a-new-tutorial">Contributing a new Tutorial</a></li>
</ul>
</li>
</ul>
</li>
</ul>

            </div>
          </div>
        </div>
      </section>
    </div>

  


  

     
       <script type="text/javascript" id="documentation_options" data-url_root="../" src="../_static/documentation_options.js"></script>
         <script src="../_static/jquery.js"></script>
         <script src="../_static/underscore.js"></script>
         <script src="../_static/doctools.js"></script>
         <script src="../_static/language_data.js"></script>
     

  

  <script type="text/javascript" src="../_static/js/vendor/popper.min.js"></script>
  <script type="text/javascript" src="../_static/js/vendor/bootstrap.min.js"></script>
  <script src="https://cdnjs.cloudflare.com/ajax/libs/list.js/1.5.0/list.min.js"></script>
  <script type="text/javascript" src="../_static/js/theme.js"></script>

  <script type="text/javascript">
      jQuery(function () {
          SphinxRtdTheme.Navigation.enable(true);
      });
  </script>
 
<script>
  (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
  (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
  m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
  })(window,document,'script','https://www.google-analytics.com/analytics.js','ga');

  ga('create', 'UA-90545585-1', 'auto');
  ga('send', 'pageview');

</script>

<script async src="https://www.googletagmanager.com/gtag/js?id=UA-117752657-2"></script>

<script>
  window.dataLayer = window.dataLayer || [];

  function gtag(){dataLayer.push(arguments);}

  gtag('js', new Date());
  gtag('config', 'UA-117752657-2');
</script>

<img height="1" width="1" style="border-style:none;" alt="" src="https://www.googleadservices.com/pagead/conversion/795629140/?label=txkmCPmdtosBENSssfsC&amp;guid=ON&amp;script=0"/>


  <!-- Begin Footer -->

  <div class="container-fluid docs-tutorials-resources" id="docs-tutorials-resources">
    <div class="container">
      <div class="row">
        <div class="col-md-4 text-center">
          <h2>Docs</h2>
          <p>Access comprehensive developer documentation for PyTorch</p>
          <a class="with-right-arrow" href="https://pytorch.org/docs/stable/index.html">View Docs</a>
        </div>

        <div class="col-md-4 text-center">
          <h2>Tutorials</h2>
          <p>Get in-depth tutorials for beginners and advanced developers</p>
          <a class="with-right-arrow" href="https://pytorch.org/tutorials">View Tutorials</a>
        </div>

        <div class="col-md-4 text-center">
          <h2>Resources</h2>
          <p>Find development resources and get your questions answered</p>
          <a class="with-right-arrow" href="https://pytorch.org/resources">View Resources</a>
        </div>
      </div>
    </div>
  </div>

  <footer class="site-footer">
    <div class="container footer-container">
      <div class="footer-logo-wrapper">
        <a href="https://pytorch.org/" class="footer-logo"></a>
      </div>

      <div class="footer-links-wrapper">
        <div class="footer-links-col">
          <ul>
            <li class="list-title"><a href="https://pytorch.org/">PyTorch</a></li>
            <li><a href="https://pytorch.org/get-started">Get Started</a></li>
            <li><a href="https://pytorch.org/features">Features</a></li>
            <li><a href="https://pytorch.org/ecosystem">Ecosystem</a></li>
            <li><a href="https://pytorch.org/blog/">Blog</a></li>
            <li><a href="https://github.com/pytorch/pytorch/blob/master/CONTRIBUTING.md">Contributing</a></li>
          </ul>
        </div>

        <div class="footer-links-col">
          <ul>
            <li class="list-title"><a href="https://pytorch.org/resources">Resources</a></li>
            <li><a href="https://pytorch.org/tutorials">Tutorials</a></li>
            <li><a href="https://pytorch.org/docs/stable/index.html">Docs</a></li>
            <li><a href="https://discuss.pytorch.org" target="_blank">Discuss</a></li>
            <li><a href="https://github.com/pytorch/pytorch/issues" target="_blank">Github Issues</a></li>
            <li><a href="https://pytorch.org/assets/brand-guidelines/PyTorch-Brand-Guidelines.pdf" target="_blank">Brand Guidelines</a></li>
          </ul>
        </div>

        <div class="footer-links-col follow-us-col">
          <ul>
            <li class="list-title">Stay Connected</li>
            <li>
              <div id="mc_embed_signup">
                <form
                  action="https://twitter.us14.list-manage.com/subscribe/post?u=75419c71fe0a935e53dfa4a3f&id=91d0dccd39"
                  method="post"
                  id="mc-embedded-subscribe-form"
                  name="mc-embedded-subscribe-form"
                  class="email-subscribe-form validate"
                  target="_blank"
                  novalidate>
                  <div id="mc_embed_signup_scroll" class="email-subscribe-form-fields-wrapper">
                    <div class="mc-field-group">
                      <label for="mce-EMAIL" style="display:none;">Email Address</label>
                      <input type="email" value="" name="EMAIL" class="required email" id="mce-EMAIL" placeholder="Email Address">
                    </div>

                    <div id="mce-responses" class="clear">
                      <div class="response" id="mce-error-response" style="display:none"></div>
                      <div class="response" id="mce-success-response" style="display:none"></div>
                    </div>    <!-- real people should not fill this in and expect good things - do not remove this or risk form bot signups-->

                    <div style="position: absolute; left: -5000px;" aria-hidden="true"><input type="text" name="b_75419c71fe0a935e53dfa4a3f_91d0dccd39" tabindex="-1" value=""></div>

                    <div class="clear">
                      <input type="submit" value="" name="subscribe" id="mc-embedded-subscribe" class="button email-subscribe-button">
                    </div>
                  </div>
                </form>
              </div>

            </li>
          </ul>

          <div class="footer-social-icons">
            <a href="https://www.facebook.com/pytorch" target="_blank" class="facebook"></a>
            <a href="https://twitter.com/pytorch" target="_blank" class="twitter"></a>
            <a href="https://www.youtube.com/pytorch" target="_blank" class="youtube"></a>
          </div>
        </div>
      </div>
    </div>
  </footer>

  <div class="cookie-banner-wrapper">
  <div class="container">
    <p class="gdpr-notice">To analyze traffic and optimize your experience, we serve cookies on this site. By clicking or navigating, you agree to allow our usage of cookies. As the current maintainers of this site, Facebook’s Cookies Policy applies. Learn more, including about available controls: <a href="https://www.facebook.com/policies/cookies/">Cookies Policy</a>.</p>
    <img class="close-button" src="../_static/images/pytorch-x.svg">
  </div>
</div>

  <!-- End Footer -->

  <!-- Begin Mobile Menu -->

  <div class="mobile-main-menu">
    <div class="container-fluid">
      <div class="container">
        <div class="mobile-main-menu-header-container">
          <a class="header-logo" href="https://pytorch.org/" aria-label="PyTorch"></a>
          <a class="main-menu-close-button" href="#" data-behavior="close-mobile-menu"></a>
        </div>
      </div>
    </div>

    <div class="mobile-main-menu-links-container">
      <div class="main-menu">
        <ul>
          <li>
            <a href="https://pytorch.org/get-started">Get Started</a>
          </li>

          <li>
            <a href="https://pytorch.org/features">Features</a>
          </li>

          <li>
            <a href="https://pytorch.org/ecosystem">Ecosystem</a>
          </li>

          <li>
            <a href="https://pytorch.org/mobile">Mobile</a>
          </li>

          <li>
            <a href="https://pytorch.org/hub">PyTorch Hub</a>
          </li>

          <li>
            <a href="https://pytorch.org/blog/">Blog</a>
          </li>

          <li>
            <a href="https://pytorch.org/tutorials">Tutorials</a>
          </li>

          <li class="active">
            <a href="https://pytorch.org/docs/stable/index.html">Docs</a>
          </li>

          <li>
            <a href="https://pytorch.org/resources">Resources</a>
          </li>

          <li>
            <a href="https://github.com/pytorch/pytorch">Github</a>
          </li>
        </ul>
      </div>
    </div>
  </div>

  <!-- End Mobile Menu -->

  <script type="text/javascript" src="../_static/js/vendor/anchor.min.js"></script>

  <script type="text/javascript">
    $(document).ready(function() {
      mobileMenu.bind();
      mobileTOC.bind();
      pytorchAnchors.bind();
      sideMenus.bind();
      scrollToAnchor.bind();
      highlightNavigation.bind();
      mainMenuDropdown.bind();
      filterTags.bind();

      // Remove any empty p tags that Sphinx adds
      $("[data-tags='null']").remove();

      // Add class to links that have code blocks, since we cannot create links in code blocks
      $("article.pytorch-article a span.pre").each(function(e) {
        $(this).closest("a").addClass("has-code");
      });
    })
  </script>
</body>
</html>